package com.infore.remoteControl.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.infore.remoteControl.entity.instructionsEntity.InstructionsType;


@Repository
public interface IInstructionTypeRepository extends JpaRepository<InstructionsType, String>, JpaSpecificationExecutor<InstructionsType>{

	/** 分页查询(指令编号排序) **/
	Page<InstructionsType> findByOrderByCode(Pageable pageable);
	/** 指令编号排序 **/
	List<InstructionsType> findByOrderByCode();
	/** 批量删除 **/
	@Modifying
	@Transactional
	int deleteByInstructionsTypeIdIn(List<String> ids);
	/** 根据指令类型名称查询 **/
	List<InstructionsType> findByName(String name);
	/** 根据指令类型编号查询 **/
	List<InstructionsType> findByCode(String code);
}
